<template>
    <div id="Address">
        <v-detail :detailData="inputData" :inputConfig="inputConfig" :rules="rules" ref="detail"></v-detail>
    </div>
</template>

<script>
import detail from "commons/Detail";
import baseMixin from "@/mixins/BaseMixin";

export default {
    name: "Address",
    mixins: [baseMixin],
    props: {
        inputData: {
            type: Object
        }
    },
    data() {
        return {
            whseidflag: false,
            rules: {},
        }
    },
    computed: {
        inputConfig() {
            return [
                [
                    {
                        type: "input",
                        label: this.$t('config.address',{no:'1'}),
                        props: "address1",
                        disabled: this.whseidflag
                    },
                    {
                        type: "input",
                        label: this.$t('config.address',{no:'2'}),
                        props: "address2",
                        disabled: this.whseidflag
                    },
                    {
                        type: "input",
                        label: this.$t('config.address',{no:'3'}),
                        props: "address3",
                        disabled: this.whseidflag
                    },
                    {
                        type: "input",
                        label: this.$t('config.address',{no:'4'}),
                        props: "address4",
                        disabled: this.whseidflag
                    },
                    {
                        type: "input",
                        label: this.$t('config.address',{no:'5'}),
                        props: "address5",
                        disabled: this.whseidflag
                    },
                    {
                        type: "input",
                        label: this.$t('config.address',{no:'6'}),
                        props: "address6",
                        disabled: this.whseidflag
                    },
                ],
                [
                    {
                        type: "input",
                        label: this.$t('bill.country'),
                        props: "country",
                        disabled: this.whseidflag
                    },
                    {
                        type: "select",
                        label: this.$t('bill.countryCode'),
                        props: "isocntrycode",
                        options: this.getOptions('querycodeLkup/ISOCOUNTRY'),
                        disabled: this.whseidflag
                    },
                    {
                        type: "input",
                        label: this.$t('config.city'),
                        props: "city",
                        disabled: this.whseidflag
                    },
                    {
                        type: "input",
                        label: this.$t('config.provice'),
                        props: "state",
                        disabled: this.whseidflag
                    },
                    {
                        type: "input",
                        label: this.$t('config.postcode'),
                        props: "zip",
                        disabled: this.whseidflag
                    },
                ],
                [
                    {
                        type: "input",
                        label: this.$t('config.contract',{no:"#1"}),
                        props: "contact1",
                        disabled: this.whseidflag
                    },
                    {
                        type: "input",
                        label: this.$t('config.contractPhone',{no:"1"}),
                        props: "phone1",
                        disabled: this.whseidflag
                    },
                    {
                        type: "input",
                        label: this.$t('config.contractFax',{no:"1"}),
                        props: "fax1",
                        disabled: this.whseidflag
                    },
                    {
                        type: "input",
                        label: this.$t('config.contractFax',{no:"1"}),
                        props: "email1",
                        disabled: this.whseidflag
                    },
                ],
                [
                    {
                        type: "input",
                        label: this.$t('config.contract',{no:"#2"}),
                        props: "contact2",
                        disabled: this.whseidflag
                    },
                    {
                        type: "input",
                        label: this.$t('config.contractPhone',{no:"2"}),
                        props: "phone2",
                        disabled: this.whseidflag
                    },
                    {
                        type: "input",
                        label: this.$t('config.contractFax',{no:"2"}),
                        props: "fax2",
                        disabled: this.whseidflag
                    },
                    {
                        type: "input",
                        label: this.$t('config.contractFax',{no:"2"}),
                        props: "email2",
                        disabled: this.whseidflag
                    }
                ]
            ]
        }
    },
    methods: {},
    mounted() {
        if (this.$store.state.wms.toUpperCase().includes('WMWHSE')) {
            //仓库级
            this.whseidflag = true;
        }
    },
    components: {
        "v-detail": detail
    }
}
</script>

<style scoped>

</style>
